package org.swimv2.utils;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Ottiene il Context necessario per avere accesso ai RemoteSessions.
 * @return Context utilizzato per il lookup.
 * @throws NamingExeption in caso non ottenimento del Context
 */
public class ContextUtil {
	public static InitialContext getInitialContext() throws NamingException {
		Properties env = new Properties();
		env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
		env.setProperty(Context.PROVIDER_URL, "localhost:1099");
		env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming");
		return new InitialContext(env);
	}
}
